<!--
 * @Author: your name
 * @Date: 2020-11-20 15:38:09
 * @LastEditTime: 2021-03-03 17:58:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \sende_nuxt\components\common\Breadcrumb.vue
-->
<template>
    <div>
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ name: 'index' }">{{
          $t("Home")
        }}</el-breadcrumb-item>
        <el-breadcrumb-item v-for="(page, index) of breadcrumbTtem" :key="'page' + index">
          <nuxt-link :to="{name: decodeURI(page)}">{{ $t(decodeURI(page)) }}</nuxt-link>
        </el-breadcrumb-item>
      </el-breadcrumb>
    </div>
</template>

<script>
import { findAll } from '~/utils/Utils'
export default {
    props: {
        breadcrumbTtem: {
            type: [Array, Object],
            default: () => []
        }
    },
    computed: {
      spliteSymbol() {
        return function (str) {
          let index = str.indexOf("-");
          if(index < 0) return str
          let _symbol = findAll(str, "-");
          let newStr = ''
          if(_symbol && _symbol.length) {
            _symbol.forEach((i) => {
              let str1 = str.substr(0, i)
              let str2 = str.substr((i+1))
              newStr = str1 + str2.slice(0, 1).toUpperCase() + str2.slice(1)
            })
          }
          return newStr
        }
      }
    }
}
</script>

<style>
</style>
